package com.lightsh.widget.testactivity;

import com.lightsh.tabhost.MyTabActivity;
import com.lightsh.tabhost.MyTabHost;

import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.TabSpec;
import com.lightsh.widget.R;

public class TabHostMainActivity extends MyTabActivity {
	
	
	private MyTabHost mTabHost;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        
        setContentView(R.layout.tab_host_layout);
        mTabHost = getTabHost();
        mTabHost.setTabWidgetAnimBackground(R.drawable.tab_selected);
        Intent intent1 = new Intent(this, ViewContentActivity.class);
        intent1.putExtra("name", "name1");
        
        Intent intent2 = new Intent(this, ViewContentActivity.class);
        intent2.putExtra("name", "name2");
        
        Intent intent3 = new Intent(this, ViewContentActivity.class);
        intent3.putExtra("name", "name3");
        
        mTabHost.addTab(mTabHost.newTabSpec("1").setIndicator("1", getResources().getDrawable(R.drawable.icon)).setContent(intent1));
        mTabHost.addTab(mTabHost.newTabSpec("2").setIndicator("2", getResources().getDrawable(R.drawable.icon)).setContent(intent2));
        mTabHost.addTab(mTabHost.newTabSpec("3").setIndicator("3", getResources().getDrawable(R.drawable.icon)).setContent(intent3));
        mTabHost.setCurrentTab(1);
    }
}